package a.j;

import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.awt.geom.Rectangle2D.Double;
import java.awt.image.BufferedImage;
import java.awt.image.ConvolveOp;
import java.awt.image.ImagingOpException;
import java.awt.image.Kernel;

public class le
  implements md.t_
{
  public static final String a = "y.view.ShadowNodePainter.SHADOW_PAINTING";
  private static final Color b = new Color(255, 255, 255, 0);
  private static final int c = 9;
  private static final double d = 2.0D;
  private final md.t_ e;
  private final int f = 10;
  private int g = 2;
  private int h = 2;
  private final ConvolveOp i;
  private final ConvolveOp j;
  private final AlphaComposite k = AlphaComposite.getInstance(5, 1.0F);
  private Color l = new Color(0, 0, 0, 77);
  public static int m;
  
  public le(md.t_ paramt_)
  {
    this.e = paramt_;
    Kernel localKernel1 = new Kernel(1, 9, a(2.0D, 9));
    this.i = new ConvolveOp(localKernel1, 1, null);
    Kernel localKernel2 = new Kernel(9, 1, a(2.0D, 9));
    this.j = new ConvolveOp(localKernel2, 1, null);
  }
  
  public md.t_ a()
  {
    return this.e;
  }
  
  public Color b()
  {
    return this.l;
  }
  
  public void a(Color paramColor)
  {
    this.l = paramColor;
  }
  
  public int c()
  {
    return this.g;
  }
  
  public void a(int paramInt)
  {
    this.g = paramInt;
  }
  
  public int d()
  {
    return this.h;
  }
  
  public void b(int paramInt)
  {
    this.h = paramInt;
  }
  
  public void a(int paramInt1, int paramInt2)
  {
    a(paramInt1);
    b(paramInt2);
  }
  
  public void a(ld paramld, Graphics2D paramGraphics2D)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2)
    {
      if (!c(paramld, paramGraphics2D)) {
        this.e.a(paramld, paramGraphics2D);
      }
    }
    else {
      return;
    }
    Rectangle2D.Double localDouble = new Rectangle2D.Double();
    paramld.b(localDouble);
    double d3 = 1.0D;
    double d2;
    if (!bool2) {
      if (!Double.isInfinite(localDouble.getWidth()))
      {
        if (bool2) {
          break label132;
        }
        if (!Double.isInfinite(localDouble.getHeight()))
        {
          d1 = localDouble.getX() - paramld.a();
          d2 = localDouble.getY() - paramld.b();
          n = (int)(localDouble.getWidth() + 1.0D);
          i1 = (int)(localDouble.getHeight() + 1.0D);
          if (bool2) {
            break label153;
          }
          if (!bool1) {
            break label151;
          }
        }
      }
    }
    label132:
    double d1 = d2 = 0.0D;
    int n = (int)paramld.c();
    int i1 = (int)paramld.d();
    label151:
    label153:
    if (!bool2)
    {
      if (n <= 256)
      {
        if (bool2) {
          break label248;
        }
        if (i1 <= 256) {}
      }
      else
      {
        d3 = 256.0D / Math.max(n, i1);
        d1 *= d3;
        d2 *= d3;
        n = (int)(n * d3);
      }
    }
    else {
      i1 = (int)(i1 * d3);
    }
    d1 -= 10.0D;
    d2 -= 10.0D;
    n += 20;
    i1 += 20;
    label248:
    if ((bool2) || ((n < 1) || (i1 < 1))) {
      return;
    }
    BufferedImage localBufferedImage1 = a(paramGraphics2D, n, i1);
    BufferedImage localBufferedImage2 = a(paramGraphics2D, n, i1);
    Graphics2D localGraphics2D = localBufferedImage1.createGraphics();
    localGraphics2D.setBackground(b);
    localGraphics2D.clearRect(0, 0, n, i1);
    AffineTransform localAffineTransform1 = localGraphics2D.getTransform();
    if (!bool2)
    {
      if (d3 != 1.0D)
      {
        localGraphics2D.translate(-d1, -d2);
        localGraphics2D.scale(d3, d3);
        localGraphics2D.translate(-paramld.a(), -paramld.b());
      }
    }
    else
    {
      if (bool2) {
        break label397;
      }
      if (!bool1) {
        break label396;
      }
    }
    localGraphics2D.translate(-paramld.a() - d1, -paramld.b() - d2);
    label396:
    label397:
    int i2 = 0;
    try
    {
      localGraphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
      localGraphics2D.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
      localGraphics2D.setRenderingHint(kg.s, kg.t);
      localGraphics2D.setRenderingHint(kg.a, kg.b);
      localGraphics2D.setRenderingHint(kg.g, kg.j);
      localGraphics2D.setRenderingHint(kg.o, kg.r);
      if (!bool2)
      {
        if (paramGraphics2D.getRenderingHint(kg.k) == kg.n) {
          localGraphics2D.setRenderingHint(kg.k, kg.n);
        }
        this.e.a(paramld, localGraphics2D);
      }
      localGraphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_DEFAULT);
      localGraphics2D.setComposite(this.k);
      localGraphics2D.setColor(this.l);
      localGraphics2D.setTransform(localAffineTransform1);
      localGraphics2D.fillRect(0, 0, n, i1);
      try
      {
        this.j.filter(localBufferedImage1, localBufferedImage2);
        this.i.filter(localBufferedImage2, localBufferedImage1);
      }
      catch (ImagingOpException localImagingOpException)
      {
        i2 = 1;
      }
    }
    finally
    {
      localGraphics2D.dispose();
    }
    if (i2 != 0)
    {
      this.e.a(paramld, paramGraphics2D);
      return;
    }
    Object localObject1 = paramGraphics2D.getRenderingHint(RenderingHints.KEY_INTERPOLATION);
    paramGraphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    AffineTransform localAffineTransform2 = AffineTransform.getTranslateInstance(this.g + paramld.a() + d1 / d3, this.h + paramld.b() + d2 / d3);
    if (!bool2) {
      if (d3 != 1.0D)
      {
        localAffineTransform2.scale(1.0D / d3, 1.0D / d3);
        paramGraphics2D.drawImage(localBufferedImage1, localAffineTransform2, null);
        if ((!bool2) && (!bool1)) {
          break label731;
        }
      }
    }
    paramGraphics2D.drawImage(localBufferedImage1, localAffineTransform2, null);
    label731:
    if (null == localObject1)
    {
      kg.a(paramGraphics2D, RenderingHints.KEY_INTERPOLATION);
      if (bool2) {
        return;
      }
      if (!bool1) {}
    }
    else
    {
      paramGraphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, localObject1);
    }
    this.e.a(paramld, paramGraphics2D);
  }
  
  private static float[] a(double paramDouble, int paramInt)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    float[] arrayOfFloat = new float[paramInt];
    float f1 = 0.0F;
    int n = 0;
    do
    {
      do
      {
        if (n >= paramInt) {
          break;
        }
        float f2 = (float)a(paramDouble, n - paramInt * 0.5D);
        arrayOfFloat[n] = f2;
        f1 += f2;
        n++;
        if (bool2) {
          break label84;
        }
        if (bool1) {
          break label82;
        }
      } while (!bool1);
    } while (bool2);
    n = 0;
    label82:
    label84:
    do
    {
      while (!bool1)
      {
        if (n >= arrayOfFloat.length) {
          break;
        }
        if ((!bool2) && (bool1)) {
          break label122;
        }
        arrayOfFloat[n] /= f1;
        n++;
      }
    } while (bool2);
    label122:
    return arrayOfFloat;
  }
  
  private static double a(double paramDouble1, double paramDouble2)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    double d1 = 1.0D / (Math.sqrt(6.283185307179586D) * paramDouble1);
    double d2 = 0.0D;
    double d3 = paramDouble2 - 0.5D;
    do
    {
      do
      {
        if (d3 >= paramDouble2 + 0.6D) {
          break;
        }
        d2 += d1 * Math.pow(2.718281828459045D, -d3 * d3 / (2.0D * paramDouble1 * paramDouble1));
        if (bool2) {
          break label109;
        }
        d3 += 0.1D;
        if (bool1) {
          break label107;
        }
      } while (!bool1);
    } while (bool2);
    d2 /= 11.0D;
    label107:
    label109:
    return d2;
  }
  
  public void b(ld paramld, Graphics2D paramGraphics2D)
  {
    this.e.b(paramld, paramGraphics2D);
  }
  
  private BufferedImage a(Graphics2D paramGraphics2D, int paramInt1, int paramInt2)
  {
    GraphicsConfiguration localGraphicsConfiguration = paramGraphics2D.getDeviceConfiguration();
    if ((ld.E) || (localGraphicsConfiguration != null)) {
      return localGraphicsConfiguration.createCompatibleImage(paramInt1, paramInt2, 3);
    }
    return new BufferedImage(paramInt1, paramInt2, 2);
  }
  
  private static boolean c(ld paramld, Graphics2D paramGraphics2D)
  {
    boolean bool = ld.E;
    if ((bool) || (kg.d(paramGraphics2D))) {
      if (!bool) {
        if ((paramld instanceof md)) {
          if (bool) {
            break label49;
          }
        }
      }
    }
    label49:
    return !Boolean.FALSE.equals(((md)paramld).c("y.view.ShadowNodePainter.SHADOW_PAINTING"));
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.le

 * JD-Core Version:    0.7.0.1

 */